"use strict";
cc._RF.push(module, '7b0e6By97BCQbXD2jaa9G02', 'ArenaBoxView');
// scripts/ArenaBoxView.js

"use strict";

var t = require;
var e = module;
var o = exports;

var _i,
    n = void 0 && (void 0).__extends || (_i = function i(t, e) {
  return (_i = Object.setPrototypeOf || {
    __proto__: []
  } instanceof Array && function (t, e) {
    t.__proto__ = e;
  } || function (t, e) {
    for (var o in e) {
      Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
  })(t, e);
}, function (t, e) {
  function o() {
    this.constructor = t;
  }

  _i(t, e), t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o());
}),
    a = void 0 && (void 0).__decorate || function (t, e, o, i) {
  var n,
      a = arguments.length,
      r = a < 3 ? e : null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
  if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);else for (var s = t.length - 1; s >= 0; s--) {
    (n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
  }
  return a > 3 && r && Object.defineProperty(e, o, r), r;
};

Object.defineProperty(o, "__esModule", {
  value: !0
});

var r = t("GlobalUserData"),
    s = t("BoxGetView"),
    l = t("Util"),
    c = cc._decorator,
    d = c.ccclass,
    h = c.property,
    p = function (t) {
  function e() {
    var e = null !== t && t.apply(this, arguments) || this;
    return e.pfb_box = null, e.redPointNode = null, e.boxValue = null, e.blocks = [], e.pro_win = null, e.label_win = null, e;
  }

  return n(e, t), e.prototype.start = function () {
    this.refreshBoxStatus();
  }, e.prototype.refreshBoxStatus = function () {
    for (var t = 0; t < this.blocks.length; t++) {
      this.blocks[t].active = !1;
    }

    this.pro_win.progress = r["default"].nArenaWinTotal % 3 / 3, this.label_win.string = (r["default"].nArenaWinTotal % 3).toString(), r["default"].nArenaWinTotal >= 3 ? this.redPointNode.active = !0 : this.redPointNode.active = !1;
    var e = Math.floor(r["default"].nArenaWinTotal / 3);
    this.boxValue.string = e.toString();
  }, e.prototype.onBtnGetBoxGift = function () {
    if (this.redPointNode.active) {
      l.Util.hideHallBanner();
      var t = cc.instantiate(this.pfb_box);
      cc.find("Canvas").addChild(t), r["default"].isArenaView = !0, console.log("点击竞技宝箱"), t.getComponent(s["default"]).showOpenBoxView(s.Box_Type.senior, null), r["default"].saveArenaWinTotal(!1), this.refreshBoxStatus();
    }
  }, a([h(cc.Prefab)], e.prototype, "pfb_box", void 0), a([h(cc.Node)], e.prototype, "redPointNode", void 0), a([h(cc.Label)], e.prototype, "boxValue", void 0), a([h([cc.Node])], e.prototype, "blocks", void 0), a([h(cc.ProgressBar)], e.prototype, "pro_win", void 0), a([h(cc.Label)], e.prototype, "label_win", void 0), a([d], e);
}(cc.Component);

o["default"] = p;

cc._RF.pop();